import Vue from 'vue'
import App from './App'
import store from './store'
import validCode from './components/validCode.vue'

Vue.component('validcode',validCode)
import {
	myAjaxNew,
	myDate,
	ageChange,
	myToUserDetail,
	myToLogin,
	timeProcessing,
	myAjaxNewPost,
	timeFromDate,
	MD5
} from 'common/common.js'
Vue.prototype.myAjaxNew = myAjaxNew //get请求
Vue.prototype.myAjaxNewPost = myAjaxNewPost //post请求
Vue.prototype.myDate = myDate //日期处理
Vue.prototype.ageChange = ageChange //年龄处理
Vue.prototype.myToUserDetail = myToUserDetail //查看用户详情
Vue.prototype.myToLogin = myToLogin //登录判断
Vue.prototype.timeProcessing = timeProcessing //时间戳转化日期格式
Vue.prototype.timeFromDate = timeFromDate//时间戳转化日期格式（只有年月）
Vue.prototype.MD5 = MD5//md5加密
Vue.prototype.$store = store
// Vue.prototype.$TIM = tim
// Vue.prototype._i18n = i18n


Vue.directive('focus', {
	// 当被绑定的元素插入到 DOM 中时……
	inserted: function(el) {
		// 聚焦元素
		el.focus()
	},
})

Vue.config.productionTip = false
App.mpType = 'app'

const app = new Vue({
	...App,
	store
	// i18n
})
app.$mount()
